<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">
    <title>Document</title>
</head>
<body>
    <script>
        var a = prompt('请输入你的年龄')
        var day = 2020;
        var year = day -a;
        alert(year);
    </script>
</body>
</html>